package tw.miku.model.gold.card;

import java.nio.charset.CharacterCodingException;

import org.apache.mina.core.buffer.IoBuffer;
import org.dom4j.Element;

import tw.miku.model.ICard;
import tw.miku.util.BufferUtility;

public class AbstractCard implements ICard
{

	private int id;
	private String name;

	public AbstractCard()
	{

	}

	@Override
	public String getName()
	{
		return name;
	}

	@Override
	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	@Override
	public Element getXmlInfo()
	{
		return null;
	}

	@Override
	public IoBuffer getInfo() throws CharacterCodingException
	{
		IoBuffer buff = IoBuffer.allocate(4);// BufferUtility.newInstance();
		buff.putUnsignedInt(getId());
		buff.position(0);
		return buff;
	}

}
